﻿<%@page contentType="text/html;charset=utf-8" pageEncoding="UTF-8" %>
<%@page import="org.ipo.mm.web.util.pager.MeetingPager, java.util.Collection, org.ipo.mm.web.util.security.SecurityManager" %>
<%@page  language="java"
         import="org.ipo.mm.web.util.*, java.util.ArrayList"%>
<%@taglib prefix="h" uri="http://struts.apache.org/tags-html"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="b" uri="http://struts.apache.org/tags-bean"%>

<div>
  
<%Collection<Integer> privileges = (Collection<Integer>) request.getSession().getAttribute(ConstantManager.SESSION_USER_PRIVILEGES);%>
<!-- HORIZONTAL MENU -->
<ul id="nav">
<li><a href="#"><b:message key="menu_meetings"/></a>
		<ul>
			<li>
			<h:link action="/protected/meeting_search.do?method=showMeetings&clearStack=true&readOnly=true">
			<b:message key="meetings_show_read_mode"/>
			</h:link>
			</li>
			<li>
			<%if (privileges.contains(SecurityManager.EDIT_MEETING_PRIVILEGE)) {%>
				<h:link action="/protected/meeting_search.do?method=showMeetings&clearStack=true&readOnly=false">
				<b:message key="meetings_show_edit_mode"/>
				</h:link>
			<%} else{%>
				<a href="#" onclick='forbiden(); return false;' class="disabled">
				<b:message key="meetings_show_edit_mode"/></a>
			<%}%>
			</li>
			<li>
			<%if (privileges.contains(SecurityManager.CREATE_MEETING_PRIVILEGE)) {%>
					<h:link action="/protected/dispatch?method=showCreateMeetingForm&rm">
                <b:message key="meetings_createnew"/>
            </h:link>
			<%}else{%>
			<a href="#" onclick="forbiden(); return false;" class="disabled">
			<b:message key="meetings_createnew"/></a>
			<%}%>
			</li>
		</ul>
		
	</li>
	<li><a href="#"><b:message key="menu_representatives"/></a>
	<ul>
		<li><h:link action="/protected/representative_search.do?method=showReprs&clearStack=true&readOnly=true">
                <b:message key="representatives_show_read_mode"/>
				 </h:link>
			</li>
			<li>
				<%if (privileges.contains(SecurityManager.EDIT_REPRESENTATIVE_PRIVILEGE)) {%>
								<h:link action="/protected/representative_search.do?method=showReprs&clearStack=true&readOnly=false">
                <b:message key="representatives_show_edit_mode"/>
            </h:link>

                    <%}
					else{%>
			<a href="#" onclick='forbiden(); return false;' class="disabled">
			<b:message key="representatives_show_edit_mode"/></a>
					<%}%>
			</li>
			<li>
			  <%if (privileges.contains(SecurityManager.CREATE_REPRESENTATIVE_PRIVILEGE)) {%>
					<h:link action="/protected/dispatch.do?method=showCreateReprForm">
                <b:message key="repr_create"/>
            </h:link>
                    <%}
					else{%>
			<a href="#" onclick="forbiden(); return false;" class="disabled">
			<b:message key="repr_create"/></a>
					<%}%>
					</li>
				<li>
					
					
								  <%if (privileges.contains(SecurityManager.SEND_BULK_MAIL_PRIVILEGE)) {%>
				<h:link action="/protected/dispatch?method=showSendMail&clearStack=true"><b:message key="menu_representatives_mails"/></h:link>
				   <%}
					else{%>
			<a href="#" onclick="forbiden(); return false;" class="disabled">
			<b:message key="menu_representatives_mails"/></a>
					<%}%>
			</li>
			<li>
			  <%if (privileges.contains(SecurityManager.PRINT_MAIL_PRIVILEGE)) {%>
			<h:link action="/protected/dispatch?method=showPrintPostMail&clearStack=true"><b:message key="menu_representatives_envelopes"/></h:link>
	   <%}
					else{%>
			<a href="#" onclick="forbiden(); return false;" class="disabled">
			<b:message key="menu_representatives_envelopes"/></a>
					<%}%>
					</li>
	</ul>			
		<div class="clear"></div>
	</li>
		<li><a href="#"><b:message key="menu_institutions"/></a>
	<ul>
	<li>
			<h:link action="/protected/institution_search?method=showInstitutions&clearStack=true&readOnly=true">
		<b:message key="institutions_show_read_mode" /></h:link>
	</li>		
<li>
			<%if (privileges.contains(SecurityManager.EDIT_INSTITUTION_PRIVILEGE)) {%>
		<h:link action="/protected/institution_search?method=showInstitutions&clearStack=true&readOnly=false">
		<b:message key="institutions_show_edit_mode" /></h:link>
                    <%}
					else{%>
			<a href="#" onclick='forbiden(); return false;' class="disabled">
			<b:message key="institutions_show_edit_mode"/></a>
					<%}%>
</li>
<li>
<h:link action="/protected/dispatch?method=showPrintPostMailInst&clearStack=true"><b:message key="menu_institutions_envelopes"/></h:link>
</li>
<li>
<h:link action="/protected/dispatch?method=showSendMailInstitution&clearStack=true"><b:message key="menu_institutions_mails"/></h:link>
</li>
<li>
			 <%if (privileges.contains(SecurityManager.CREATE_INSTITUTION_PRIVILEGE)) {%>
<h:link action="/protected/dispatch?method=showCreateInstForm&clearStack=true"><b:message key="inst_create"/></h:link>
<%} else{%>
			<a href="#" onclick="forbiden(); return false;" class="disabled">
			<b:message key="inst_create"/></a>
					<%}%>
					</li>
	</ul>			
		<div class="clear"></div>
	</li>	
	<li><a href="#"><b:message key="menu_families"/></a>
	<ul>
	<li>
		  <h:link action="/protected/dispatch?method=showFamilies&clearStack=true&readOnly=true"><b:message key="families_show_read_mode" /></h:link>
	</li>
	<li>		
			<%if (privileges.contains(SecurityManager.EDIT_IFAMILY_PRIVILEGE)) {%>
			<h:link action="/protected/dispatch?method=showFamilies&clearStack=true&readOnly=false"><b:message key="families_show_edit_mode" /></h:link>
            <%} else{%>
			<a href="#" onclick='forbiden(); return false;' class="disabled">
			<b:message key="families_show_edit_mode"/></a>
			<%}%>
</li>
	<li>		
	
		
			<% if (privileges.contains(SecurityManager.CREATE_IFAMILY_PRIVILEGE)) {%>
<h:link action="/protected/dispatch?method=showCreateFamilyForm">
<b:message key="families_create"/></h:link>
<%} else{%>
<a href="#" onclick="forbiden(); return false;" class="disabled">
			<b:message key="families_create"/></a>
					<%}%>
	</li>
	<li>		
	
	</ul>			
		<div class="clear"></div>
	</li>	
	<li><a href="#"><b:message key="menu_types"/></a>
	<ul>
	<li>
			  <h:link action="/protected/dispatch?method=showTypes&clearStack=true&readOnly=true"><b:message key="types_show_read_mode" /></h:link>
	</li>
	<li>
			<%
            if (privileges.contains(SecurityManager.EDIT_ITYPE_PRIVILEGE)) {
                    %>
                     <h:link action="/protected/dispatch?method=showTypes&clearStack=true&readOnly=false"><b:message key="types_show_edit_mode" /></h:link>    <% } else {%>
					 <a href="#" onclick='forbiden(); return false;' class="disabled">
			<b:message key="types_show_edit_mode"/></a>
					 <%}%>
</li>
	<li>
		
			<% if (privileges.contains(SecurityManager.CREATE_ITYPE_PRIVILEGE)) {%>

<h:link action="/protected/dispatch?method=showCreateTypeForm&clearStack=true"><b:message key="types_create"/></h:link>

<%} else{%>
<a href="#" onclick="forbiden(); return false;" class="disabled">
			<b:message key="types_create"/></a>

<%}%>
</li>
	<li>
	</ul>			
		<div class="clear"></div>
	</li>	
	<li>
	<a href="#"><b:message key="menu_regions"/></a>
	<ul>
		<li>
		<% if (privileges.contains(SecurityManager.READ_IREGION_PRIVILEGE)) {%>
			<h:link action="/protected/dispatch?method=showRegions&clearStack=true&readOnly=true">
			<b:message key="regions_show_read_mode"/>
			</h:link>
			<%} else{%>
			<a href="#" onclick="forbiden(); return false;" class="disabled">
			<b:message key="regions_show_read_mode"/>
			</a>
			<%}%>
</li>
<li>
			<% if (privileges.contains(SecurityManager.EDIT_IREGION_PRIVILEGE)) {%>
			<h:link action="/protected/dispatch?method=showRegions&clearStack=true&readOnly=false">
			<b:message key="regions_show_edit_mode" />
			</h:link>
			<%} else{%>
			<a href="#" onclick="forbiden(); return false;" class="disabled">
			<b:message key="regions_show_edit_mode"/>
			</a>
			<%}%>
</li>
<li>

			<% if (privileges.contains(SecurityManager.CREATE_IREGION_PRIVILEGE)) {%>
			<h:link action="/protected/dispatch?method=showCreateRegionForm&clearStack=true"><b:message key="regions_create"/></h:link>
			<%} else{%>
			<a href="#" onclick="forbiden(); return false;" class="disabled">
			<b:message key="regions_create"/></a>
			<%}%>
</li>
			
	</ul>			
		<div class="clear"></div>
	</li>	
	<li>
	<a href="#"><b:message key="menu_cities"/></a>
	<ul>
		<li>
					<h:link action="/protected/dispatch?method=showCities&clearStack=true&readOnly=true">
			<b:message key="cities_show_read_mode" />
			</h:link>
			</li>
			<li>
			<%if (privileges.contains(SecurityManager.EDIT_CITY_PRIVILEGE)) {%>

<h:link action="/protected/dispatch?method=showCities&clearStack=true&readOnly=false">
			<b:message key="cities_show_edit_mode" /></h:link>

<%} else{%>

			<a href="#" onclick="forbiden(); return false;" class="disabled">
			<b:message key="cities_show_edit_mode" /></a>

<%}%>
</li>
<li>
					<%if (privileges.contains(SecurityManager.CREATE_CITY_PRIVILEGE)) {%>
	<h:link action="/protected/dispatch?method=showCreateCityForm&clearStack=true"><b:message key="cities_create"/></h:link>

<%} else{%>

			<a href="#" onclick="forbiden(); return false;" class="disabled">
			<b:message key="cities_create"/></a>

<%}%>
</li>
<li>

	</ul>			
		<div class="clear"></div>
	</li>	
	<li>
<%if (privileges.contains(SecurityManager.DISPLAY_REPORTS_MENU_PRIVILEGE)) {%>
<h:link action="/protected/dispatch?method=showReportsMenu&clearStack=true"><b:message key="reports_title"/></h:link>
<%} else{%>
<a href="#" onclick="forbiden(); return false;" class="disabled">
<b:message key="reports_title"/></a>
<%}%>
	</li>
		<li>
		<a href="#"><b:message key="user_type_admin"/></a>
	<ul>
		<li>
		<%if (privileges.contains(SecurityManager.READ_USER_PRIVILEGE)) {%>
<h:link action="/protected/dispatch?method=showUsers&clearStack=true"><b:message key="menu_users"/></h:link>
<%} else{%>
<a href="#" onclick="forbiden(); return false;" class="disabled">
<b:message key="menu_users"/></a>
<%}%>
</li>
<li>
	<%if (privileges.contains(SecurityManager.READ_USER_PRIVILEGE)) {%>
	<h:link action="/protected/dispatch?method=showCreateUserForm&clearStack=true"><b:message key="user_create"/></h:link>
	<%} else{%>
	<a href="#" onclick="forbiden(); return false;" class="disabled">
	<b:message key="user_create"/></a>
	<%}%>
</li>
<li>
	<%if (privileges.contains(SecurityManager.READ_USER_PRIVILEGE)) {%>
		<h:link action="/protected/log_search?method=readLog&clearStack=true">
		<b:message key="menu_log"/>
		</h:link>
		<%} else{%>
		<a href="#" onclick="forbiden(); return false;" class="disabled">
		<b:message key="menu_log"/></a>
		<%}%>
</li>
<li>
	</ul>			
		<div class="clear"></div>
	</li>
</ul>
<!-- HORIZONTAL MENU END-->

	
			
			</div>